
var navs= document.querySelector("nav");
window.onscroll = function() {
	console.log(document.documentElement.scrollTop);
	//判断它距离顶部的位置
	if(document.documentElement.scrollTop >700|| document.body.scrollTop > 700) {
		navs.className = "nav-fixed";
	} else {
		navs.className = "";
	}
}
var h = document.querySelectorAll("#h>li");

h[0].onclick = function(){
	document.documentElement.scrollTop = 700
}
h[1].onclick = function(){
	document.documentElement.scrollTop = 1500;
}
h[2].onclick = function(){
	document.documentElement.scrollTop = 2700;
}

//点击显示所有
var btn = document.querySelector('#btn');
var three=document.querySelector('#three');
var main=document.querySelector('#main');
var a=true
btn.onclick=function(){
	if(a){
		btn.style.background='#000000';
		btn.style.color='#fff'
		three.style.display='block';
		main.style.height='1290px';
	}else{
		btn.style.background='';
		btn.style.color=''
		three.style.display='';
		main.style.height='';
	}
	a=!a
}